<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ZENBOSS - <?php echo $__ITEMS['topic']['topic_title']?></title>
<link href="/storage/css/default.css" rel="stylesheet" type="text/css" />
<style>
.login_box{
	float:left;
	border:2px solid #ccc;
	width:165px;
	height:auto;
	padding:20px;
	}
.txt_input{
	width:250px;
	border:1px solid #bbb;
	padding:2px;
	}
</style>

<script type="text/javascript">
function change_v(id){
	var v_obj=document.getElementById(id);
	v_obj.style.backgroundImage="url(/tools.php?do=v&"+Math.random()+")";
//	v_obj.style.paddingLeft="40px";
//	
//	v_obj.style.width='110px';
//alert('ddddeeddd');
}
function show_submit_div(){
	var sd = document.getElementById('submit_div');

	if(sd.style.display=='none'){
		sd.style.display='block';
		
	}else{
		sd.style.display='none';
	}
	
}

</script>

</head>
<body>

<div class="top">
	<div class="top_inner" ><img src="/storage/img/phpyu_text.jpg" />Beta
	</div>
</div>
<div class="body">

<table width="75%">
	<tr bgcolor="#dddddd">
		<td style="padding:8px;border-left:5px solid <?php echo ($__ITEMS['is_top']>0?"#f00":"#888")?> ;">

<?php /**************** 打印文章 ***************/ ?>
			<div style="float:left;">
				<?php $topic = &$__ITEMS['topic']; //便捷变量?>
				
				<strong style="font-size:16px;">
					<?php echo ($topic['topic_title'])?>
				</strong>
				&nbsp;&nbsp;<u><?php echo date('Y-m-d',$topic['topic_birthday'])?></u>
				<?php echo ($topic['topic_top_order']>0?'&nbsp;<strong style="color:#f00;">[置顶]</strong>':'');
					  echo ($topic['topic_is_best']==1?'&nbsp;<strong style="color:#f00;">[精华]</strong>':'');
					  echo ($topic['topic_is_recommend']==1?'&nbsp;<strong style="color:#f00;">[推荐]</strong>':'');
				?>
			</div>
			<div style="float:right;">
				<a href="/index.php?do=topic_update&tid=<?php echo $topic['topic_tid']?>"><em>管理</em></a>
				&nbsp;&nbsp;
				<a href="/service.php?do=get_pwd&tid=<?php echo $topic['topic_tid']?>"><em>忘记密码</em></a>
			</div>
<?php /**************** 打印文章 end***************/ ?>
		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td style="padding:8px 18px 8px 18px;">
			<div class="list_inner_text">
			<?php echo $__ITEMS['theme_pic_html'].html_BBCode2html__(lib_media_BBCode2html(nl2br(($__ITEMS['topic_body']))));
				echo ($__ITEMS['tag_text']?'<br /><br /><span style="color:#888888;">tag:'.$__ITEMS['tag_text'].'</span>':'');
			?>
			</div>
		</td>
	</tr>
	<tr bgcolor="#ffffff">
		<td style="padding:8px;">
<?php /********************** 作者信息 *************************/ ?>

			作者：
			<strong><a href="mailto:<?php echo ($topic_mail=str_replace('@','#',$topic['topic_email']))?>"><?php echo $topic_mail?></a>
			</strong>
			&nbsp;|&nbsp;
			<?php echo date('Y-m-d H:i:s',$topic['topic_birthday'])?>
			&nbsp;|&nbsp;评论：[<?php echo $topic['topic_reply_count']?>]
			&nbsp;|&nbsp;阅读：(<?php echo $topic['topic_see_count']?>)
<?php /********************** 作者信息 END*************************/ ?>
		</td>
	</tr>
	<tr><td><center><hr width="30%" size="1" /><br /></center></td></tr>
	

	
<?php /********************** 打印评论回复*************************/ ?>	

	<?php foreach ($__ITEMS['reply_arr'] as $reply): 
	$color = ( time() - $reply['reply_birthday'] < 3600  ? '#44f' : '#888'); //判断是否是新回复(一小时内)
		if ($reply['reply_is_show']!=1) {                       //如果评论被关闭
			$bg_color = '#f3f3f3';                              //修改背景颜色
			$txt_color = 'color:#aaaaaa;';                      //改变文字颜色
			$mail_address = strtok($reply['reply_email'],'@');
			$reply['reply_body'] = '- 该评论被撤消 - ';
																//修改提示文字
			$reply['reply_email'] = $mail_address.'#****.***';
			$del_text = '<a href="index.php?do=reply_unclose&rid='.$reply['reply_tid'].'"><em>还原</em></a>';
		}else {
			$bg_color = '#e3e3e3';
			$txt_color = '';
			$del_text = '<a href="index.php?do=reply_close&rid='.$reply['reply_tid'].'"><em>删除</em></a>';
		}
	?>

	<tr bgcolor="<?php echo $bg_color?>">
		<td style="padding:8px;border-right:5px solid <?php echo $color?>;<?php echo $txt_color?>">
			<span style="font-size:15px;float:left;<?php echo $txt_color?>">
				<?php echo ($reply['reply_title']?'<strong style="font-size:16px;">'.$reply['reply_title'].'</strong><br />':'') ?>
				<?php echo nl2br($reply['reply_body'])?>
			</span>
			<div style="float:right;">
				<?php echo date('Y-m-d H:i:s',$reply['reply_birthday'])?>
				&nbsp;
				<strong><a href="mailto:<?php echo ($reply_mail=strtr($reply['reply_email'],"@","#"))?>"><?php echo $reply_mail ?></a></strong>
				&nbsp;
				<a href="index.php?do=reply_update&rid=<?php echo $reply['reply_tid']?>"><em>管理</em></a>
				&nbsp;
				<?php echo $del_text?>
			</div>
		
		</td>
	</tr>

		
	<?php endforeach; ?>
<?php /********************** 打印评论回复 END*************************/ ?>

<tr><td><center><br /><hr width="30%" size="1" /><br /></center></td></tr>


<tr bgcolor="#bbbbbb">
	<td style="padding:8px;border-left:5px solid #444444"><strong style="font-size:14px;"><a href="#sub" onclick="show_submit_div();">『我要评价』</a></strong></td>
</tr>
<tr bgcolor="#ffffff">
	
	<td style="padding:8px 18px 8px 18px;">

		<div id="submit_div" style="display:block<?php //echo $__ERRORS?'block':'none' ?>;">
			<form method="POST" action="/index.php?do=new_reply&tid=<?php echo $__ITEMS['tid'] ?>">
				<table>
					<?php if (!empty($__ITEMS['user'])):  ?>
					<tr><td align="right">E-mail&nbsp;：</td><td><?php echo $__ITEMS['user']['club_user_email'],' (',$__ITEMS['user']['club_user_name'],')' ?></td></tr>
					<tr><td align="right">密&nbsp;&nbsp;&nbsp;&nbsp;码：</td><td>用户登录密码</td></tr>
					<tr><td align="right">确认密码：</td><td>略过</td></tr>
					<?php else:?>
					<tr><td align="right">E-mail&nbsp;：</td><td><input type="text" name="email" id="email" size="35" class="txt_input" value="<?php echo $__ITEMS['email'] ?>"  />&nbsp;很重要,日后找回文章密码需要他<?php html_showMessages_($__ERRORS['email'],'#f00','<br />'); ?></td></tr>
					<tr><td align="right">密&nbsp;&nbsp;&nbsp;&nbsp;码：</td><td><input type="password" name="pwd" id="pwd" size="35" class="txt_input"   />&nbsp;很重要,用来管理你发表的文章(每篇文章都拥有独立的密码)<?php html_showMessages_($__ERRORS['pwd'],'#f00','<br />'); ?></td></tr>
					<tr><td align="right">确认密码：</td><td><input type="password" name="pwd2" id="pwd2" size="35" class="txt_input"  />&nbsp;重复一次上面的密码<?php html_showMessages_($__ERRORS['pwd2'],'#f00','<br />'); ?></td></tr>
					<?php endif;?>
					<tr><td align="right">文章标题：</td><td><input type="text" name="title" id="title" class="txt_input" style="width:550px;" value="<?php echo $__ITEMS['title'] ?>"   /><?php html_showMessages_($__ERRORS['title'],'#f00','<br />'); ?></td></tr>
					<tr><td align="right">文章内容：</td><td><textarea name="body" id="body" rows="10" class="txt_input" style="width:550px;" ><?php echo $__ITEMS['body'] ?></textarea><?php html_showMessages_($__ERRORS['body'],'#f00','<br />'); ?></td></tr>
					<tr><td></td><td><input class="txt_input" type="submit" value="提交" />&nbsp;&nbsp;<input class="txt_input" type="reset" value="重置" /></td></tr>
				</table>
				<a name="sub" />
			</form>
		</div>
		
	</td>

</tr>
<tr><td><center><hr width="30%" size="1" /><br /></center></td></tr>
</table>


</div>

</div>
<?php include('foot.php') ?>
</body>
</html>
